<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ChatRoomToChatUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('chat_room_to_chat_users', function (Blueprint $table) {
        	$table->id();
        	$table->integer('chat_room_id');
        	$table->integer('chat_user_id');
        	$table->timestamps();
        	
        	$table->index(['chat_room_id', 'chat_user_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('chat_room_to_chat_users');
    }
}
